<?php
if(!isset($GLOBALS['_vars'])) $GLOBALS['_vars'] = array(); 
$fields = array();
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>项目总览</title>
        <link rel="stylesheet" href="style.css" type="text/css">
        <script src="/chart/amcharts/amcharts.js" type="text/javascript"></script>
        <script src="/chart/amcharts/serial.js" type="text/javascript"></script>         
 <script type="text/javascript">
            var chart;
            var chartData = [
			<?php 
			$ab22 = "select  SUBSTRING(from_unixtime(shenqingshijian,'%Y-%m-%d'),1,4) as y22 from aier_addon22";
            $dsql->Execute('m22', $ab22);          
            $arcArr22 = array();       
            while($row22 = $dsql->GetArray('m22'))
             {
               $arcArr22[] = $row22['y22'];
             }
			$ab = "select  SUBSTRING(from_unixtime(shqshijian,'%Y-%m-%d'),1,4) as y from aier_addon23";
            $dsql->Execute('m', $ab);          
            $arcArr = array();       
            while($row = $dsql->GetArray('m'))
             {
               $arcArr[] = $row['y'];
             }		
			$ab23 = "select  SUBSTRING(from_unixtime(shqshijian,'%Y-%m-%d'),1,4) as y23 from aier_addon23";
            $dsql->Execute('m23', $ab23);          
            $arcArr23 = array();       
            while($row23 = $dsql->GetArray('m23'))
             {
               $arcArr23[] = $row23['y23'];
             }
			$ab24 = "select  SUBSTRING(from_unixtime(shenqingshijian,'%Y-%m-%d'),1,4) as y24 from aier_addon24";
            $dsql->Execute('m24', $ab24);          
            $arcArr24 = array();       
            while($row24 = $dsql->GetArray('m24'))
             {
               $arcArr24[] = $row24['y24'];
             }
			$ab25 = "select  SUBSTRING(from_unixtime(shenqingshijian,'%Y-%m-%d'),1,4) as y25 from aier_addon25";
            $dsql->Execute('m25', $ab25);          
            $arcArr25 = array();       
            while($row25 = $dsql->GetArray('m25'))
             {
               $arcArr25[] = $row25['y25'];
             }
			$ab26 = "select  SUBSTRING(from_unixtime(zizhushijian,'%Y-%m-%d'),1,4) as y26 from aier_addon26";
            $dsql->Execute('m26', $ab26);          
            $arcArr26 = array();       
            while($row26 = $dsql->GetArray('m26'))
             {
               $arcArr26[] = $row26['y26'];
             }
			$ab27 = "select  SUBSTRING(from_unixtime(shenqingshijian,'%Y-%m-%d'),1,4) as y27 from aier_addon27";
            $dsql->Execute('m27', $ab27);          
            $arcArr27 = array();       
            while($row27 = $dsql->GetArray('m27'))
             {
               $arcArr27[] = $row27['y27'];
             }
			$ab28 = "select  SUBSTRING(from_unixtime(shqshijian,'%Y-%m-%d'),1,4) as y28 from aier_addon28";
            $dsql->Execute('m28', $ab28);          
            $arcArr28 = array();   
            while($row28 = $dsql->GetArray('m28'))
             {
               $arcArr28[] = $row28['y28'];
             }
			$ab29 = "select  SUBSTRING(from_unixtime(shenqingshijian,'%Y-%m-%d'),1,4) as y29 from aier_addon29";
            $dsql->Execute('m29', $ab29);          
            $arcArr29 = array();       
            while($row29 = $dsql->GetArray('m29'))
             {
               $arcArr29[] = $row29['y29'];
             }			 
			    $sql_ym_2016 = "SELECT COUNT(*) AS ddym2016 FROM aier_addon23 where zizhujine <>  '0' and from_unixtime(shqshijian,'%Y-%m-%d') like '%2016%'  ";
                $arr_ym_2016 = $dsql->GetOne($sql_ym_2016);
			    $ym2016 = $arr_ym_2016['ddym2016'];
			    $sql_ym_2017 = "SELECT COUNT(*) AS ddym2017 FROM aier_addon23 where zizhujine <>  '0' and from_unixtime(shqshijian,'%Y-%m-%d') like '%2017%'   ";
                $arr_ym_2017 = $dsql->GetOne($sql_ym_2017);
			    $ym2017 = $arr_ym_2017['ddym2017'];
			    $sql_ym_2018 = "SELECT COUNT(*) AS ddym2018 FROM aier_addon23 where zizhujine <>  '0' and from_unixtime(shqshijian,'%Y-%m-%d') like '%2018%'  ";
                $arr_ym_2018 = $dsql->GetOne($sql_ym_2018);
			    $ym2018 = $arr_ym_2018['ddym2018'];
			    $sql_ym_2019 = "SELECT COUNT(*) AS ddym2019 FROM aier_addon23 where zizhujine <>  '0' and from_unixtime(shqshijian,'%Y-%m-%d') like '%2019%'  ";
                $arr_ym_2019 = $dsql->GetOne($sql_ym_2019);
			    $ym2019 = $arr_ym_2019['ddym2019'];
			    $sql_my_2016 = "SELECT COUNT(*) AS ddmy2016 FROM aier_addon22 where zizhujine <>  '0' and from_unixtime(shenqingshijian,'%Y-%m-%d') like '%2016%'  ";
                $arr_my_2016 = $dsql->GetOne($sql_my_2016);
			    $my2016 = $arr_my_2016['ddmy2016'];
			    $sql_my_2017 = "SELECT COUNT(*) AS ddmy2017 FROM aier_addon22 where zizhujine <>  '0' and  from_unixtime(shenqingshijian,'%Y-%m-%d') like '%2017%'   ";
                $arr_my_2017 = $dsql->GetOne($sql_my_2017);
			    $my2017 = $arr_my_2017['ddmy2017'];
			    $sql_my_2018 = "SELECT COUNT(*) AS ddmy2018 FROM aier_addon22 where zizhujine <>  '0' and  from_unixtime(shenqingshijian,'%Y-%m-%d') like '%2018%'   ";
                $arr_my_2018 = $dsql->GetOne($sql_my_2018);
			    $my2018 = $arr_my_2018['ddmy2018'];
			    $sql_my_2019 = "SELECT COUNT(*) AS ddmy2019 FROM aier_addon22 where zizhujine <>  '0' and  from_unixtime(shenqingshijian,'%Y-%m-%d') like '%2019%'  ";
                $arr_my_2019 = $dsql->GetOne($sql_my_2019);
			    $my2019 = $arr_my_2019['ddmy2019'];
			    $sql_xrk_2016 = "SELECT COUNT(*) AS ddxrk2016 FROM aier_addon25 where   zizhujine <>  '0' and from_unixtime(shenqingshijian,'%Y-%m-%d') like '%2016%'  ";
                $arr_xrk_2016 = $dsql->GetOne($sql_xrk_2016);
			    $xrk2016 = $arr_xrk_2016['ddxrk2016'];
			    $sql_xrk_2017 = "SELECT COUNT(*) AS ddxrk2017 FROM aier_addon25 where   zizhujine <>  '0' and   from_unixtime(shenqingshijian,'%Y-%m-%d') like '%2017%' ";
                $arr_xrk_2017 = $dsql->GetOne($sql_xrk_2017);
			    $xrk2017 = $arr_xrk_2017['ddxrk2017'];
			    $sql_xrk_2018 = "SELECT COUNT(*) AS ddxrk2018 FROM aier_addon25 where  zizhujine <>  '0' and  from_unixtime(shenqingshijian,'%Y-%m-%d') like '%2018%'  ";
                $arr_xrk_2018 = $dsql->GetOne($sql_xrk_2018);
			    $xrk2018 = $arr_xrk_2018['ddxrk2018'];
			    $sql_xrk_2019 = "SELECT COUNT(*) AS ddxrk2019 FROM aier_addon25 where   zizhujine <>  '0' and  from_unixtime(shenqingshijian,'%Y-%m-%d') like '%2019%'  ";
                $arr_xrk_2019 = $dsql->GetOne($sql_xrk_2019);
			    $xrk2019 = $arr_xrk_2019['ddxrk2019'];
			    $sql_jxj_2016 = "SELECT COUNT(*) AS ddjxj2016 FROM aier_addon28 where zizhujine <>  '0' and  from_unixtime(shqshijian,'%Y-%m-%d') like '%2016%'  ";
                $arr_jxj_2016 = $dsql->GetOne($sql_jxj_2016);
			    $jxj2016 = $arr_jxj_2016['ddjxj2016'];
			    $sql_jxj_2017 = "SELECT COUNT(*) AS ddjxj2017 FROM aier_addon28 where zizhujine <>  '0' and  from_unixtime(shqshijian,'%Y-%m-%d') like '%2017%'  ";
                $arr_jxj_2017 = $dsql->GetOne($sql_jxj_2017);
			    $jxj2017 = $arr_jxj_2017['ddjxj2017'];
			    $sql_jxj_2018 = "SELECT COUNT(*) AS ddjxj2018 FROM aier_addon28 where zizhujine <>  '0' and  from_unixtime(shqshijian,'%Y-%m-%d') like '%2018%'  ";
                $arr_jxj_2018 = $dsql->GetOne($sql_jxj_2018);
			    $jxj2018 = $arr_jxj_2018['ddjxj2018'];
			    $sql_jxj_2019 = "SELECT COUNT(*) AS ddjxj2019 FROM aier_addon28 where zizhujine <>  '0' and  from_unixtime(shqshijian,'%Y-%m-%d') like '%2019%'   ";
                $arr_jxj_2019 = $dsql->GetOne($sql_jxj_2019);
			    $jxj2019 = $arr_jxj_2019['ddjxj2019'];				
			    $sql_yc_2016 = "SELECT COUNT(*) AS ddyc2016 FROM aier_addon24 where zizhujine <>  '0' and  from_unixtime(shenqingshijian,'%Y-%m-%d') like '%2016%' and num=1   ";
                $arr_yc_2016 = $dsql->GetOne($sql_yc_2016);
			    $yc2016 = $arr_yc_2016['ddyc2016'];
			    $sql_yc_2017 = "SELECT COUNT(*) AS ddyc2017 FROM aier_addon24 where zizhujine <>  '0' and  from_unixtime(shenqingshijian,'%Y-%m-%d') like '%2017%' and num=1   ";
                $arr_yc_2017 = $dsql->GetOne($sql_yc_2017);
			    $yc2017 = $arr_yc_2017['ddyc2017'];
			    $sql_yc_2018 = "SELECT COUNT(*) AS ddyc2018 FROM aier_addon24 where zizhujine <>  '0' and  from_unixtime(shenqingshijian,'%Y-%m-%d') like '%2018%' and num=1   ";
                $arr_yc_2018 = $dsql->GetOne($sql_yc_2018);
			    $yc2018 = $arr_yc_2018['ddyc2018'];
                $sql_yc_2019 = "SELECT COUNT(*) AS ddyc2019 FROM aier_addon24 where zizhujine <>  '0' and  from_unixtime(shenqingshijian,'%Y-%m-%d') like '%2019%' and num=1  ";
                $arr_yc_2019 = $dsql->GetOne($sql_yc_2019);
			    $yc2019 = $arr_yc_2019['ddyc2019'];
			    $sql_tsj_2016 = "SELECT COUNT(*) AS ddtsj2016 FROM aier_addon27 where zizhujine <>  '0' and  from_unixtime(shenqingshijian,'%Y-%m-%d') like '%2016%'  ";
                $arr_tsj_2016 = $dsql->GetOne($sql_tsj_2016);
			    $tsj2016 = $arr_tsj_2016['ddtsj2016'];
			    $sql_tsj_2017 = "SELECT COUNT(*) AS ddtsj2017 FROM aier_addon27 where zizhujine <>  '0' and  from_unixtime(shenqingshijian,'%Y-%m-%d') like '%2017%' ";
                $arr_tsj_2017 = $dsql->GetOne($sql_tsj_2017);
			    $tsj2017 = $arr_tsj_2017['ddtsj2017'];
			    $sql_tsj_2018 = "SELECT COUNT(*) AS ddtsj2018 FROM aier_addon27 where zizhujine <>  '0' and  from_unixtime(shenqingshijian,'%Y-%m-%d') like '%2018%' ";
                $arr_tsj_2018 = $dsql->GetOne($sql_tsj_2018);
			    $tsj2018 = $arr_tsj_2018['ddtsj2018'];
			    $sql_tsj_2019 = "SELECT COUNT(*) AS ddtsj2019 FROM aier_addon27 where zizhujine <>  '0' and  from_unixtime(shenqingshijian,'%Y-%m-%d') like '%2019%' ";
                $arr_tsj_2019 = $dsql->GetOne($sql_tsj_2019);
			    $tsj2019 = $arr_tsj_2019['ddtsj2019'];				
			    $sql_sdk_2016 = "SELECT COUNT(*) AS ddsdk2016 FROM aier_addon26 where zizhujine <>  '0' and  from_unixtime(zizhushijian,'%Y-%m-%d') like '%2016%' ";
                $arr_sdk_2016 = $dsql->GetOne($sql_sdk_2016);
			    $sdk2016 = $arr_sdk_2016['ddsdk2016'];
			    $sql_sdk_2017 = "SELECT COUNT(*) AS ddsdk2017 FROM aier_addon26 where zizhujine <>  '0' and  from_unixtime(zizhushijian,'%Y-%m-%d') like '%$year%' ";
                $arr_sdk_2017 = $dsql->GetOne($sql_sdk_2017);
			    $sdk2017 = $arr_sdk_2017['ddsdk2017'];
			    $sql_sdk_2018 = "SELECT COUNT(*) AS ddsdk2018 FROM aier_addon26 where zizhujine <>  '0' and  from_unixtime(zizhushijian,'%Y-%m-%d') like '%2018%' ";
                $arr_sdk_2018 = $dsql->GetOne($sql_sdk_2018);
			    $sdk2018 = $arr_sdk_2018['ddsdk2018'];
			    $sql_sdk_2019 = "SELECT COUNT(*) AS ddsdk2019 FROM aier_addon26 where zizhujine <>  '0'  and  from_unixtime(zizhushijian,'%Y-%m-%d') like '%2019%' ";
                $arr_sdk_2019 = $dsql->GetOne($sql_sdk_2019);
			    $sdk2019 = $arr_sdk_2019['ddsdk2019'];	
			    $sql_ot_2016 = "SELECT COUNT(*) AS ddot2016 FROM aier_addon29 where from_unixtime(zizhuriqi,'%Y-%m-%d') like '%2016%' ";
                $arr_ot_2016 = $dsql->GetOne($sql_ot_2016);
			    $ot2016 = $arr_ot_2016['ddot2016'];
			    $sql_ot_2017 = "SELECT COUNT(*) AS ddot2017 FROM aier_addon29 where from_unixtime(zizhuriqi,'%Y-%m-%d') like '%$year%' ";
                $arr_ot_2017 = $dsql->GetOne($sql_ot_2017);
			    $ot2017 = $arr_ot_2017['ddot2017'];
			    $sql_ot_2018 = "SELECT COUNT(*) AS ddot2018 FROM aier_addon29 where from_unixtime(zizhuriqi,'%Y-%m-%d') like '%2018%' ";
                $arr_ot_2018 = $dsql->GetOne($sql_ot_2018);
			    $ot2018 = $arr_ot_2018['ddot2018'];
			    $sql_ot_2019 = "SELECT COUNT(*) AS ddot2019 FROM aier_addon29 where from_unixtime(zizhuriqi,'%Y-%m-%d') like '%2019%' ";
                $arr_ot_2019 = $dsql->GetOne($sql_ot_2019);
			    $ot2019 = $arr_ot_2019['ddot2019'];
            if(in_array("2016", $arcArr)||in_array("2016", $arcArr22)||in_array("2016", $arcArr24)||in_array("2016", $arcArr25)||in_array("2016", $arcArr26)||in_array("2016", $arcArr27)||in_array("2016", $arcArr28)) 
			echo "{
                    \"year\": \"2016\",
                     \"yuanmeng\":  ".$ym2016.",
                     \"meiyu\": ".$my2016.",
                     \"xiangrikui\":".$xrk2016.",
					 \"supingjiangxuejin\":".$jxj2016.",
					 \"yucai\": ".$yc2016.",
					 \"tushujiao\":".$tsj2016." ,
					 \"sidake\":".$sdk2016." ,
					 \"other\":".$ot2016." 
                },";
			echo "{
                    \"year\": \"2017\",
                     \"yuanmeng\":  ".$ym2017.",
                     \"meiyu\": ".$my2017.",
                     \"xiangrikui\": ".$xrk2017.",
					 \"supingjiangxuejin\": ".$jxj2017.",
					 \"yucai\": ".$yc2017.",
					 \"tushujiao\":".$tsj2017." ,
					 \"sidake\":".$sdk2017." ,
					 \"other\":".$ot2016." 
                },
				{
                    \"year\": \"2018\",
                     \"yuanmeng\":  ".$ym2018.",
                     \"meiyu\": ".$my2018.",
                     \"xiangrikui\": ".$xrk2018.",
					 \"supingjiangxuejin\": ".$jxj2018.",
					 \"yucai\": ".$yc2018.",
					 \"tushujiao\": ".$tsj2018.",
					 \"sidake\": ".$sdk2018.",
					 \"other\":".$ot2016." 
                },
				";
            if(in_array("2019", $arcArr)||in_array("2019", $arcArr22)||in_array("2019", $arcArr24)||in_array("2019", $arcArr25)||in_array("2019", $arcArr26)||in_array("2019", $arcArr27)||in_array("2019", $arcArr28)||in_array("2019", $arcArr29)) 
			echo "{
                    \"year\": \"2019\",
                     \"yuanmeng\":  ".$ym2019.",
                     \"meiyu\": ".$my2019.",
                     \"xiangrikui\":".$xrk2019.",
					 \"supingjiangxuejin\":".$jxj2019.",
					 \"yucai\": ".$yc2019.",
					 \"tushujiao\":".$tsj2019." ,
					 \"sidake\":".$sdk2019." ,
					 \"other\":".$ot2019." 
                },";				
				?>
            ];
            AmCharts.ready(function () {
                // SERIAL CHART
                chart = new AmCharts.AmSerialChart();
                chart.pathToImages = "/chart/amcharts/images/";
                chart.dataProvider = chartData;
                chart.categoryField = "year";
                chart.addTitle("救助人数总览", 15);
                // AXES
                // Category
                var categoryAxis = chart.categoryAxis;
                categoryAxis.gridAlpha = 0.07;
                categoryAxis.axisColor = "#DADADA";
                categoryAxis.startOnAxis = true;
                // Value
                var valueAxis = new AmCharts.ValueAxis();
                valueAxis.title = "百分比"; // this line makes the chart "stacked"
                valueAxis.stackType = "100%";
                valueAxis.gridAlpha = 0.07;
                chart.addValueAxis(valueAxis);
                // GRAPHS
                // first graph
                var graph = new AmCharts.AmGraph();
                graph.type = "line"; // it's simple line graph
                graph.title = "爱尔圆梦";
                graph.valueField = "yuanmeng";
                graph.lineAlpha = 0;
                graph.fillAlphas = 0.6; // setting fillAlphas to > 0 value makes it area graph
                graph.balloonText = "<span style='width:220px;'>爱尔圆梦：<span style='font-size:14px; color:#000000;'><b>[[value]] &nbsp;[[percents]]%</b></span></span>";
                chart.addGraph(graph);
                // second graph
                graph = new AmCharts.AmGraph();
                graph.type = "line";
                graph.title = "爱尔美育";
                graph.valueField = "meiyu";
                graph.lineAlpha = 0;
                graph.fillAlphas = 0.6;
                graph.balloonText = "<span style='width:220px;'>爱尔美育：<span style='font-size:14px; color:#000000;'><b>[[value]] &nbsp;[[percents]]%</b></span></span>";
                chart.addGraph(graph);
                // third graph
                graph = new AmCharts.AmGraph();
                graph.type = "line";
                graph.title = "爱尔向日葵";
                graph.valueField = "xiangrikui";
                graph.lineAlpha = 0;
                graph.fillAlphas = 0.6;
                graph.balloonText = "<span style='width:220px;'>爱尔向日葵：<span style='font-size:14px; color:#000000;'><b>[[value]] &nbsp;[[percents]]%</b></span></span>";
                chart.addGraph(graph);
                // forth graph
                graph = new AmCharts.AmGraph();
                graph.type = "line";
                graph.title = "苏萍奖学金";
                graph.valueField = "supingjiangxuejin";
                graph.lineAlpha = 0;
                graph.fillAlphas = 0.6;
                graph.balloonText = "<span style='width:220px;'>苏萍奖学金：<span style='font-size:14px; color:#000000;'><b>[[value]] &nbsp;[[percents]]%</b></span></span>";
                chart.addGraph(graph);
                // fifth graph
                graph = new AmCharts.AmGraph();
                graph.type = "line";
                graph.title = "爱尔育才";
                graph.valueField = "yucai";
                graph.lineAlpha = 0;
                graph.fillAlphas = 0.6;
                graph.balloonText = "<span style='width:220px;'>爱尔育才：<span style='font-size:14px; color:#000000;'><b>[[value]] &nbsp;[[percents]]%</b></span></span>";
                chart.addGraph(graph);
                // sixth graph
                graph = new AmCharts.AmGraph();
                graph.type = "line";
                graph.title = "爱尔图书角";
                graph.valueField = "tushujiao";
                graph.lineAlpha = 0;
                graph.fillAlphas = 0.6;
                graph.balloonText = "<span style='width:220px;'>爱尔图书角：<span style='font-size:14px; color:#000000;'><b>[[value]] &nbsp;[[percents]]%</b></span></span>";
                chart.addGraph(graph);
                // seventh graph
                graph = new AmCharts.AmGraph();
                graph.type = "line";
                graph.title = "斯达克世界从此欢声笑语";
                graph.valueField = "sidake";
                graph.lineAlpha = 0;
                graph.fillAlphas = 0.6;
                graph.balloonText = "<span style='width:220px;'>斯达克世界从此欢声笑语：<span style='font-size:14px; color:#000000;'><b>[[value]] &nbsp;[[percents]]%</b></span></span>";
                chart.addGraph(graph);
                 // eighth graph
                graph = new AmCharts.AmGraph();
                graph.type = "line";
                graph.title = "其他项目";
                graph.valueField = "other";
                graph.lineAlpha = 0;
                graph.fillAlphas = 0.6;
                graph.balloonText = "<span style='width:220px;'>其他项目：<span style='font-size:14px; color:#000000;'><b>[[value]] &nbsp;[[percents]]%</b></span></span>";
                chart.addGraph(graph);
               // LEGEND
                var legend = new AmCharts.AmLegend();
                legend.align = "center";
                legend.valueText = "[[value]] ([[percents]]%)";
                legend.valueWidth = 100;
                legend.valueAlign = "left";
                legend.equalWidths = false;
                legend.periodValueText = "救助人数: [[value.sum]]"; // this is displayed when mouse is not over the chart.
                chart.addLegend(legend);
                // CURSOR
                var chartCursor = new AmCharts.ChartCursor();
                chartCursor.zoomable = false; // as the chart displayes not too many values, we disabled zooming
                chartCursor.cursorAlpha = 0;
                chart.addChartCursor(chartCursor);
                // WRITE
                chart.write("chartdiv");
            });
        </script>
    </head>
    <body>
<div style="height:42px; line-height:42px; border-bottom:1px solid #CCCCCC; color:#333; font-family:'微软雅黑'; font-size:14px;">当前位置：<a href="data_index.php" target="main" style="height:42px; line-height:42px; color:#333; font-family:'微软雅黑'; font-size:14px;">数据分析</a> > 救助人数总览 > </div>
        <div id="chartdiv" style="width:100%; height:400px;"></div>
     </body>
</html>